#ifndef __LCD_H__
#define __LCD_H__

#include "lcdcontroller.h"
#include "config.h"




#define LCD_BPP			(16)
// james deng 02052007
//#define LCD_BPP			(24)	// we use 666, so we 3 bytes
// james deng 02052007
#define LCD_FRAMERATE   (60)


#define TFT240_320	1			// TFT LCD 240*320
#define TFT640_480	4			// TFT LCD 640*480
#define TFT480_272  5           // TFT LCD 480*272  // Ryn20060605

// #define LCD_TYPE	TFT480_272 

// james deng 02052007
// for CASIO panel
#define UT_LCD_TYPE	TFT240_320
// james deng 02052007

//zep_0627 start
#if   (UT_LCD_TYPE == TFT240_320)
#define LCD_WIDTH		 (240)
#define LCD_HEIGHT	     (320)
#elif (UT_LCD_TYPE == TFT640_480)
#define LCD_WIDTH		 (640)
#define LCD_HEIGHT	     (480)
#elif (UT_LCD_TYPE == TFT480_272) 
#define LCD_WIDTH		 (480) 
#define LCD_HEIGHT	     (272) 
#endif
//zep_0627  end

// LCD register value...  

#if (UT_LCD_TYPE == TFT240_320)
#define MIC_LCD_XSIZE_TFT       (240)
#define MIC_LCD_YSIZE_TFT       (320)
#elif (UT_LCD_TYPE == TFT640_480)
#define MIC_LCD_XSIZE_TFT       (640)
#define MIC_LCD_YSIZE_TFT       (480)
#elif (UT_LCD_TYPE == TFT480_272)      // Ryn20060605
#define MIC_LCD_XSIZE_TFT       (480)
#define MIC_LCD_YSIZE_TFT       (272)
#endif

#define HOZVAL_TFT          (MIC_LCD_XSIZE_TFT-1)
#define LINEVAL_TFT         (MIC_LCD_YSIZE_TFT-1)

//TFT timing parameter for V16C6448AB(PRIME VIEW) 

#if (UT_LCD_TYPE == TFT640_480)
#define VBPD                ((35)&0xff)
#define VFPD                ((3)&0xff)
#define VSPW                ((3) &0x3f)

#define HBPD                ((120)&0x7f)
#define HFPD                ((19)&0xff)
#define HSPW                ((18)&0xff)

#elif (UT_LCD_TYPE == TFT240_320)
/*
#define VBPD                ((3-1)&0xff)	//((1)&0xff)
#define VFPD                ((3-1)&0xff)	//((2)&0xff)
#define VSPW                ((1-1) &0x3f)	//((1) &0x3f)

#define HBPD                ((17-1)&(0x7f))	//((6)&0x7f)
#define HFPD                ((11-1)&(0xff))	//((2)&0xff)
#define HSPW                ((5-1)&(0xff))	//((4)&0xff)
*/
// james deng 02052007
#define VBPD                ((2)&0xff)	
#define VFPD                ((2)&0xff)	
#define VSPW                ((2) &0x3f)	

#define HBPD                ((7)&(0x7f))	
#define HFPD                ((29)&(0xff))	
#define HSPW                ((10)&(0xff))	
// james deng 02052007

#elif (UT_LCD_TYPE == TFT480_272)

#define VBPD                ((2-1)&0xff)	//((1)&0xff)
#define VFPD                ((4-1)&0xff)	//((2)&0xff)
#define VSPW                ((10-1) &0x3f)	//((1) &0x3f)

#define HBPD                ((4-1)&(0x7f))	//((6)&0x7f)
#define HFPD                ((8-1)&(0xff))	//((2)&0xff)
#define HSPW                ((41-1)&(0xff))	//((4)&0xff)
#endif

#endif							// __LCD_H__
